package com.example.comsumer;

import com.example.comsumer.client.RpcProxy;
import com.rpctest.myrpc.common.IuserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName controller
 * @Description TODO
 * @Author 11
 * @Date 2021/4/1 16:56
 * @Version 1.0
 */
//
@RestController
public class controller {

    @RequestMapping("/test")
    public Object test(){

        //这是调用方法
        RpcProxy rpcClientProxy = new RpcProxy();
        IuserService hgHello = rpcClientProxy.getProxy(IuserService.class,"localhost",9000);

        return hgHello.findUserID(2).getName();
    }


}
